Package-level declarations

Types

Link copied to clipboard

Specifies the settings for an Axis.

Link copied to clipboard
Link copied to clipboard

A scope for configuring a bullet graph.

Link copied to clipboard
Link copied to clipboard
data class BulletGraphScope constructor(scopes: MutableList<BulletBuilderScope<*>> = mutableListOf(), var labelWidth: LabelWidth = VariableFraction(@Suppress("MagicNumber") 0.25f))

A scope for constructing displays that layout and align features among multiple bullet graphs.

Link copied to clipboard

Default implementation of a BarChartEntry.

Link copied to clipboard
data class DefaultVerticalBarPlotStackedPointEntry<X, Y>(val x: X, val yOrigin: Y, val y: List<Y>) : VerticalBarPlotStackedPointEntry<X, Y>
Link copied to clipboard
data class DefaultVerticalBarPosition<Y>(val yMin: Y, val yMax: Y) : VerticalBarPosition<Y>
Link copied to clipboard
data class Fixed(size: Dp) : LabelWidth

Set the label width as a fixed size in Dp. If the label is smaller than the size it will be right-justified to the graph.

Link copied to clipboard
data class FixedFraction(fraction: Float) : LabelWidth

Set the label width as a fixed fraction of the overall graph width. If the label is smaller than the fixed fraction it will be right-justified to the graph.

Link copied to clipboard

Receiver scope used by GroupedVerticalBarPlot.

Link copied to clipboard
sealed class LabelWidth

Sealed class hierarchy to designate the label area width type and values.

Link copied to clipboard
open class Slot<T>(default: T)

A slot to hold a configurable value in the bullet graph dsl.

Link copied to clipboard

Receiver scope used by StackedVerticalBarPlot.

Link copied to clipboard

Scope item to allow adding items to a StackedVerticalBarPlot.

Link copied to clipboard
data class VariableFraction(fraction: Float) : LabelWidth

Set the label width as a variable fraction of the overall graph width. If the label is smaller than the fraction the graph will grow to occupy the available space.

Link copied to clipboard
typealias VerticalBarComposable<E> = @Composable BarScope.(series: Int, index: Int, value: E) -> Unit

Defines a Composable function used to emit a vertical bar. The parameter series is the chart data series index. The parameter index is the element index within the series. The parameter value is the value of the element.

Link copied to clipboard

An interface that defines a data element to be plotted on a Bar chart.

Link copied to clipboard

Represents a set of points for a GroupedVerticalBarPlot.

Link copied to clipboard

Scope item to allow adding items to a VerticalBarPlot.

Link copied to clipboard

Represents a set of data points for a StackedVerticalBarPlot.

Link copied to clipboard

An interface that defines the y-axis coordinates for vertical bars on a bar plot.

Functions

Link copied to clipboard
fun BulletGraphs(modifier: Modifier = Modifier, gap: Dp = KoalaPlotTheme.sizes.gap, animationSpec: AnimationSpec<Float> = KoalaPlotTheme.animationSpec, builder: BulletGraphScope.() -> Unit)

A vertical layout of multiple bullet graphs. Each bullet will equally share the vertical space and be the same height. The left and right edges of all bullets will be aligned horizontally.

Link copied to clipboard
fun BarScope.DefaultVerticalBar(color: Color, shape: Shape = RectangleShape, border: BorderStroke? = null)

A simplified DefaultVerticalBar that uses a Solid Color color and default RectangleShape.

fun BarScope.DefaultVerticalBar(brush: Brush, modifier: Modifier = Modifier, shape: Shape = RectangleShape, border: BorderStroke? = null, hoverElement: @Composable () -> Unit = {})

A default implementation of a bar for bar charts.

Link copied to clipboard
fun DiamondIndicator(color: Color = MaterialTheme.colorScheme.primary, size: Dp)
fun DiamondIndicator(color: Color = MaterialTheme.colorScheme.primary, sizeFraction: Float = DefaultSizeFraction)

A diamond-shaped indicator that may be used as a feature marker.

Link copied to clipboard
fun <X, Y> XYGraphScope<X, Y>.GroupedVerticalBarPlot(modifier: Modifier = Modifier, maxBarGroupWidth: Float = 0.9f, animationSpec: AnimationSpec<Float> = KoalaPlotTheme.animationSpec, content: GroupedVerticalBarPlotScope<X, Y>.() -> Unit)
fun <X, Y, E : VerticalBarPlotGroupedPointEntry<X, Y>> XYGraphScope<X, Y>.GroupedVerticalBarPlot(data: List<E>, modifier: Modifier = Modifier, bar: @Composable BarScope.(dataIndex: Int, groupIndex: Int, entry: E) -> Unit = { i, g, _ -> val colors = remember(data) { generateHueColorPalette(data.maxOf { it.y.size }) } DefaultVerticalBar( brush = SolidColor(colors[g]), modifier = Modifier.fillMaxWidth(KoalaPlotTheme.sizes.barWidth) ) }, maxBarGroupWidth: Float = 0.9f, animationSpec: AnimationSpec<Float> = KoalaPlotTheme.animationSpec)

A Vertical Bar Plot to be used in an XYGraph and that plots multiple series side-by-side.

Link copied to clipboard
fun HorizontalBarIndicator(brush: Brush, modifier: Modifier = Modifier, fraction: Float = 1.0f, shape: Shape = RectangleShape, border: BorderStroke? = null)

A default implementation of a bar indicator that can be used for the featured measure or qualitative ranges.

Link copied to clipboard
fun LineIndicator(color: Color = MaterialTheme.colorScheme.primary, heightFraction: Float = DefaultSizeFraction, width: Dp = 2.dp)

A line for comparative measure indicators.

Link copied to clipboard
fun solidBar(color: Color, shape: Shape = RectangleShape, border: BorderStroke? = null): @Composable BarScope.() -> Unit

Factory function to create a Composable that emits a solid colored bar.

Link copied to clipboard
fun <X> XYGraphScope<X, Float>.StackedVerticalBarPlot(modifier: Modifier = Modifier, barWidth: Float = 0.9f, animationSpec: AnimationSpec<Float> = KoalaPlotTheme.animationSpec, content: StackedVerticalBarPlotScope<X>.() -> Unit)

A Vertical Bar Plot to be used in an XYGraph and that plots multiple series as a stack of bars.

fun <X, Y, E : VerticalBarPlotStackedPointEntry<X, Y>> XYGraphScope<X, Y>.StackedVerticalBarPlot(data: List<E>, modifier: Modifier = Modifier, bar: @Composable BarScope.(xIndex: Int, barIndex: Int) -> Unit, barWidth: Float = 0.9f, animationSpec: AnimationSpec<Float> = KoalaPlotTheme.animationSpec)

Composes a stacked vertical bar plot. This is a convenience method which defers to VerticalBarPlot. A stacked bar plot can be also achieved by placing multiple VerticalBarPlots on an io.github.koalaplot.core.xygraph.XYGraph, one for each "layer" of bars.

Link copied to clipboard
fun <X, Y> XYGraphScope<X, Y>.VerticalBarPlot(defaultBar: @Composable BarScope.() -> Unit = solidBar(Color.Blue), modifier: Modifier = Modifier, barWidth: Float = 0.9f, animationSpec: AnimationSpec<Float> = KoalaPlotTheme.animationSpec, content: VerticalBarPlotScope<X, Y>.() -> Unit)

Creates a Vertical Bar Plot.

fun <X, Y, E : VerticalBarPlotEntry<X, Y>> XYGraphScope<X, Y>.VerticalBarPlot(data: List<E>, modifier: Modifier = Modifier, bar: @Composable BarScope.(index: Int) -> Unit, barWidth: Float = 0.9f, animationSpec: AnimationSpec<Float> = KoalaPlotTheme.animationSpec)

A VerticalBarPlot to be used in an XYGraph and that plots data points as vertical bars.

fun <X> XYGraphScope<X, Float>.VerticalBarPlot(xData: List<X>, yData: List<Float>, modifier: Modifier = Modifier, bar: @Composable BarScope.(index: Int) -> Unit, barWidth: Float = 0.9f, animationSpec: AnimationSpec<Float> = KoalaPlotTheme.animationSpec)

A VerticalBarPlot to be used in an XYGraph and that plots a single series of data points as vertical bars.

Link copied to clipboard
fun <X, Y> verticalBarPlotEntry(x: X, yMin: Y, yMax: Y): VerticalBarPlotEntry<X, Y>

Convenience function for creating a VerticalBarPlotEntry.

Link copied to clipboard

Convenience function for creating a VerticalBarPosition.